<template>
  <u-form-item
    :label="label"
    :prop="props.data.field"
    :required="props.data.required"
    :rules="props.data.rules"
  >
    <u-rate
      v-model="val"
      :max="props.data.max"
      :allow-half="props.data.allowHalf"
      :readonly="props.data.readonly"
      :disabled="props.data.disabled"
    />
  </u-form-item>
</template>

<script setup lang="ts">
import { useProps, useValue } from '../hooks/props'

const props = defineProps<{ data: Record<string, any>; form: Record<string, any> }>()
const emits = defineEmits(['valueChange'])

const { label } = useProps(props)
const { val } = useValue(props, emits)
</script>

<style lang="scss" scoped></style>
